<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateSuppliersTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::dropIfExists('suppliers');
        Schema::create('suppliers', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->string('company', '50')->index()->nullable()->comment('公司名称');
            $table->string('number', '50')->index()->nullable()->comment('编号');
            $table->string('province', 190)->index()->nullable()->comment('地址-省份');
            $table->string('city', 190)->index()->nullable()->comment('地址-城市');
            $table->string('county', 190)->index()->nullable()->comment('地址-区/县');
            $table->string('address', 255)->nullable()->comment('地址-详细地址');
            $table->string('lat', 255)->nullable()->comment('位置信息纬度');
            $table->string('lng', 255)->nullable()->comment('位置信息经度');
            $table->string('name', 50)->index()->nullable()->comment('联系人');
            $table->string('phone', 50)->index()->nullable()->comment('联系电话');
            $table->string('mobile', 50)->index()->nullable()->comment('联系手机号码');
            $table->string('description', '255')->nullable()->comment('描述');
            $table->integer('status')->index()->default(1)->comment('状态：1.正常，2.禁用');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('suppliers');
    }
}
